import tab from "./tab";
import auth from "./auth";
import cache from "./cache";
import modal from "./modal";
import download from "./download";
import type animate from "@/animate";
import useDict from "@/utils/dict";
import { handleTree } from "@/utils/lychee";

declare module "@vue/runtime-core" {
	interface ComponentCustomProperties {
		$modal: typeof modal;
		$tab: typeof tab;
		$download: typeof download;
		$auth: typeof auth;
		$cache: typeof cache;

		useDict: typeof useDict;
		handleTree: typeof handleTree;
		animate: typeof animate;
	}
}

export default function installPlugins(app: any) {
	// 页签操作
	app.config.globalProperties.$tab = tab;
	// 认证对象
	app.config.globalProperties.$auth = auth;
	// 缓存对象
	app.config.globalProperties.$cache = cache;
	// 模态框对象
	app.config.globalProperties.$modal = modal;
	// 下载文件
	app.config.globalProperties.$download = download;
};
